Repository navigation
fix: align fast parser with default parser on whitespace and multiline quoted values - #1047
Closed
vaibhavmashal wants to merge 1 commit into
Closed
vaibhavmashal wants to merge 1 commit into
vaibhavmashal wants to merge 1 commit into
Conversation
…e quoted values
- Handle whitespace characters (\f, \v, \u00A0) in fast parser scanner matching default regex behavior
- Support multiline quoted values across blank lines after separator
- Align trailing junk fallback behavior after closing quote
- Add unit tests verifying parity between parse() and parse(..., { fast: true })
Fixes #1043
Owner
|
fixing here: #1056 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns the fast parser (
parse(src, { fast: true })) with the default regex parser to address divergences described in #1043:Summary of Changes
Multiline Quoted Values Across Blank Lines After Separator:
The default regex parser allows leading whitespace (including newlines) before a quoted value (e.g.,
A=\n\n"hello\nworld"). The scanner now detects when a newline is crossed after the separator before encountering a quote, parsing the quoted value across multiple lines while matching empty fallback behavior if trailing junk exists.Whitespace Parity (
\f,\v,\u00A0):Expanded fast scanner whitespace detection to include Form Feed (
\f/ 12), Vertical Tab (\v/ 11), Non-breaking Space (\u00A0/ 160), BOM (\uFEFF/ 65279), Space (/ 32), Tab (\t/ 9), and Newline (\n/ 10).Trailing Junk Handling After Closing Quote:
Aligned raw fallback behavior when trailing junk follows a closing quote on the same line (e.g.
TOKEN="abc" oops).Test Coverage:
Added
tests/test-fast-parity.jsto ensure parity across all aforementioned cases.Fixes #1043